﻿#pragma once


#include <QDialog>
#include <QPushButton>
#include "QListView"
#include "QStringListModel"
#include "QFileDialog"
#include "QMessageBox"
#include "QApplication"
#include "QVBoxLayout"
#include <QDesktopWidget>
#include <QLibrary>
#include <QApplication>
#include <QFrame>
#include <QLabel>
#include <QComboBox>
#include "QListView"
#include "QStringListModel"
#include "QLineEdit"
#include "QSpinBox"
#include <QSettings>

#include "commonfunction.h"

#include "halcon_opencv.h"

using namespace std;

#include "qt_graphics_view.h"
#include "function_create_shape_model.h"


class DetectionFrankMatch :public QDialog
{
public:

	GraphicsShapeRectangleCirce* m_graphics_shape_rectangle;
	int row1, column1, row2, column2;

	QString m_dir;
	QSettings* m_qsettings;
	Mat m_image;
	HObject m_xld_show;
	QString m_section = "";
	
	

	QLabel*   m_qlabel_score_standard;
	QDoubleSpinBox* m_qdoublespinbox_score_standard;
	double    m_score_standard = 0;


	
	QPushButton* m_pushbutton_create_new_model;
	QPushButton* m_pushbutton_show_model;
	QPushButton* m_pushbutton_show_orign_image;
	QPushButton* m_pushbutton_detection;
	QPushButton* m_pushbutton_save_parameter;
	QPushButton* m_pushbutton_return;


	QtQGraphicsView* m_view;
	QLabel*          m_view_pixel_qlabel;

	Mat m_image_model;
	
	HTuple m_model;
	HObject m_xld_model;
	int Row1, Column1, Row2, Column2;
public:
	explicit DetectionFrankMatch(QDialog *parent = nullptr, QSettings* qsettings = nullptr, QString section = "", QString dir = "");
	~DetectionFrankMatch();
	void detectionImage();
	bool detection(HObject image_in, QString& message);
	void draw(Mat image_in, Mat& image_out);
	void loadParameter();
	void saveParameter();
	bool showDialog();
	void createModel();
	void showModel();
};
#pragma execution_character_set("utf-8")
